//
//  SearchValueTableViewCell.swift
//  ZNZXSuperMarket
//
//  Created by 四川中农 on 2018/8/1.
//  Copyright © 2018年 四川中农. All rights reserved.
//

import UIKit

class SearchValueTableViewCell: UITableViewCell {

    @IBOutlet weak var titleLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func reload(withkeyBoard value:String,searchValue:String){
        let attributeString = NSMutableAttributedString.init(string: value)
        attributeString.addAttributes([NSAttributedStringKey.foregroundColor:UIColor.init(hexColor: "#cccccc")], range: NSString.init(string:value).range(of: searchValue))
        self.titleLabel.attributedText = attributeString
    }
    
}
